package bultin;

import javax.swing.JCheckBox;
import javax.swing.JComponent;

import pseudo_ASH.RightTabPane;
import pseudo_ASH.RightTabPane.Tabs;
import code.TokenType;

import com.sydwell.service.ArrayPlus;


class CheckBox_Bi extends BIClass {
	JComponent jo = null;

	public CheckBox_Bi() {
		super("CheckBox");
		addMethod(JavaObjectMethods.getBackground);
		addMethod(JavaObjectMethods.getForeground);
		addMethod(JavaObjectMethods.getValue);
		addMethod(JavaObjectMethods.isSelected);
		addMethod(JavaObjectMethods.setBackground);
		addMethod(JavaObjectMethods.setForeground);
		addMethod(JavaObjectMethods.setSelected);
		addMethod(JavaObjectMethods.setValue);
		
	}

	@Override
	public JComponent makeJavaComp(String theInstanceName,
			ArrayPlus<TokenType> arguments) {
		jo = new JCheckBox(arguments.get(0).getTokenText());
		RightTabPane.add2OutputDisplay(jo);
		RightTabPane.tab2Display(Tabs.OUTPUT);
		return jo;
	}

	@Override
	public String getJavaClassName() {
		return "JCheckBox";
	}


	
	
//	class OnClick extends BuiltinMethod {
//		
//		public OnClick() {
//			super("onClick", true, false);
//			super.addParameter(varType.INTEGER);
//		}
//
//		@Override
//		public Variable excuteMethod(ArrayPlus<TokenType> argumentList) {
////			try {
////				ErrorCondition.checkArugmentList(argumentList, argumentOptions);
////			} catch (ErrorCondition e) {
////				return returnVariable;
////			}
//			String str = argumentList.get(0).getTokenVariable().getStrValue();
//			returnVariable.setAndConvert("" + str.length());
//			return returnVariable;
//		}
//	}
}
